<?php

namespace app\common\enum;

/**
 * 系统渠道
 */
class ChannelEnum
{
    // 系统渠道
    const H5 = 1;//H5端
    const WX_OA = 2;//微信公众号
    const WX_AP = 3;//微信小程序
    const PC = 4;//PC端
    const APP = 5;//APP端

    /**
     * 获取渠道类型
     * @param bool $value
     * @return string|string[]
     */
    public static function getChannelDesc($value = true)
    {
        $data = [
            self::H5 => 'H5端',
            self::WX_OA => '微信公众号',
            self::WX_AP => '微信小程序',
            self::APP => 'APP端',
            self::PC => 'PC端',
        ];
        if ($value === true) {
            return $data;
        }
        return $data[$value] ?? '';
    }
}